﻿using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[,] matrix = new int[n, n];
        PrintA(n, matrix);
        Console.WriteLine();
    }

    private static void PrintA(int n, int[,] matrix)
    {
        for (int r = 0, rCounter = 1; r < matrix.GetLength(0); r++, rCounter++)
        {
            for (int c = 0, cCounter = 0; c < matrix.GetLength(1); c++, cCounter = cCounter + n)
            {
                matrix[r, c] = rCounter + cCounter;
                Console.Write("{0,3}", matrix[r, c]);

            }
            Console.WriteLine();
        }
    }
}